package main

import (
	logic "GameLogic"
	"GameServer"
	"SGNet"
	"misc/seelog"
	"runtime"
	corecfg "utils/config"
)

func main() {

	seelog.Info(runtime.NumCPU())
	runtime.GOMAXPROCS(runtime.NumCPU())
	initGame()
	initlog()
	GameServer.RunServer()
	SGNet.Run()

}

func initlog() {
	logger, err := seelog.LoggerFromConfigAsFile("seelog.xml")
	if err != nil {
		seelog.Critical("err parsing config log file", err)
		return
	}
    seelog.ReplaceLogger(logger)
}

func initGame() {
	corecfg.Load()
	logic.Load()
}
